package com.hspedu.poly_;

public class Master {
    String name;

    public Master(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    //使用多态机制可以统一管理主任喂食的问题
    public void feed(Animal animal , Food food){
        System.out.println("主人"+ name  + "给" +animal.getName() + "吃" + food.getName() );
    }
}
